CREATE TABLE [Category]( 
    [CategoryID] [int] IDENTITY(1,1) NOT NULL, 
    [CategoryName] [nvarchar](64) NOT NULL, 
CONSTRAINT [PK_Categories] PRIMARY KEY CLUSTERED 
( 
    [CategoryID] ASC 
) ON [PRIMARY] 
) ON [PRIMARY]

CREATE TABLE [CategoryLog]( 
    [CategoryLogID] [int] IDENTITY(1,1) NOT NULL, 
    [CategoryID] [int] NOT NULL, 
    [LogID] [int] NOT NULL, 
CONSTRAINT [PK_CategoryLog] PRIMARY KEY CLUSTERED 
( 
    [CategoryLogID] ASC 
) ON [PRIMARY] 
) ON [PRIMARY]

CREATE TABLE [Log]( 
    [LogID] [int] IDENTITY(1,1) NOT NULL, 
    [EventID] [int] NULL, 
    [Priority] [int] NOT NULL, 
    [Title] [nvarchar](256) NOT NULL, 
    [MachineName] [nvarchar](32) NOT NULL, 
    [AppDomainName] [nvarchar](512) NOT NULL, 
    [ThreadName] [nvarchar](512) NULL, 
    [Message] [nvarchar](1500) NULL, 
CONSTRAINT [PK_Log] PRIMARY KEY CLUSTERED 
( 
    [LogID] ASC 
) ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]